﻿using System.Linq;
using System.Text.RegularExpressions;
using Framework.Extensions;

namespace Framework.Metadata
{
    public class NamingConventionConverter
    {
        public string ConvertName(string sourceName)
        {
            var nameParts = Regex.Split(sourceName, "(?=[A-Z])").Where(s => s.Length > 0);
            return nameParts
                .Select(name => name.ToLower()).SeparateBy("_");
        }
    }
}